package com.yuandian.api.management.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yuandian.api.management.validate.InsertFlag;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.Digits;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

/**
 * 步骤配置表-实体
 * @author zfsn
 * @date 2023-3-14
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "步骤配置表", description = "")
@TableName("conf_step")
public class ConfStep extends BasePage<ConfStep> {

	/**
	 * 主键，唯一标识数据
	 */
	@NotNull(message = "步骤id不能为空", groups = {InsertFlag.class})
	@Digits(integer = Integer.MAX_VALUE, fraction = 0, message = "步骤id只能为整数且不能为空", groups = {InsertFlag.class})
	@ApiModelProperty(value = "主键", notes = "主键，唯一标识数据")
	@TableId(type = IdType.AUTO)
	private Integer id;

	/**
	 * 所属系统id
	 */
	@NotNull(message = "系统id不为空")
	@ApiModelProperty(value = "所属系统id", notes = "所属系统id")
	private Integer systemId;

	/**
	 * 所属业务编码
	 */
	@NotNull(message = "所属业务编码不为空")
	@ApiModelProperty(value = "所属业务编码", notes = "所属业务编码")
	private String businessCode;

	/**
	 * 步骤编码(绑定的业务服务资源编码)
	 */
	@NotNull(message = "步骤编码不能为空")
	@ApiModelProperty(value = "步骤编码", notes = "步骤编码(绑定的业务服务资源编码)")
	private String stepCode;

	/**
	 * 步骤名称
	 */
	@NotNull(message = "步骤名称不为空")
	@ApiModelProperty(value = "步骤名称", notes = "步骤名称")
	private String name;

	/**
	 * 步骤类型，1：首步骤、2：中间步骤、3：末步骤
	 */
	@NotNull(message = "步骤类型不为空")
	@ApiModelProperty(value = "步骤类型", notes = "步骤类型，1：首步骤、2：中间步骤、3：末步骤")
	private Integer type;

	/**
	 * 是否确认，0：否(默认)、1：是
	 */
	@ApiModelProperty(value = "是否确认", notes = "是否确认，0：否(默认)、1：是")
	private Integer isConfirm;

	/**
	 * 是否配置组合策略，0：否(默认)、1：是
	 */
	@ApiModelProperty(value = "是否配置组合策略", notes = "是否配置组合策略，0：否(默认)、1：是")
	private Integer isCombinedStrategy;

	/**
	 * 是否允许失败，0：否(默认)、1：是
	 */
	@ApiModelProperty(value = "是否允许失败", notes = "是否允许失败，0：否(默认)、1：是")
	private Integer isAllowFail;

	/**
	 * 是否允许缺失，0：否(默认)、1：是
	 */
	@ApiModelProperty(value = "是否允许缺失", notes = "是否允许缺失，0：否(默认)、1：是")
	private Integer isAllowLose;

	/**
	 * 显示顺序
	 */
	@ApiModelProperty(value = "显示顺序", notes = "显示顺序")
	private Integer sequence;

	/**
	 * 创建人
	 */
	@ApiModelProperty(value = "创建人", notes = "创建人")
	private String createBy;


	/**
	 * 创建时间
	 */
	@ApiModelProperty(value = "创建时间", notes = "创建时间")
	private LocalDateTime createTime;

	/**
	 * 更新人
	 */
	@ApiModelProperty(value = "更新人", notes = "更新人")
	private String updateBy;

	/**
	 * 更新时间
	 */
	@ApiModelProperty(value = "更新时间", notes = "更新时间")
	private LocalDateTime updateTime;

	/**
	 * 是否逻辑删除，0：否、1：是
	 */
	@ApiModelProperty(value = "是否逻辑删除", notes = "是否逻辑删除，0：否、1：是")
	private Integer isDel;

	/**
	 * 备注
	 */
	@ApiModelProperty(value = "备注", notes = "备注")
	private String remarks;

	/**
	 *
	 */
	@TableField(exist = false)
	@ApiModelProperty(value = "从redis中获取sessionid进行回填专属指标", notes = "")
	private String getSessionidIndicator;

	/**
	 *
	 */
	@TableField(exist = false)
	@ApiModelProperty(value = "保存sessionid到redis专属指标", notes = "")
	private String saveSessionidIndicator;

	/**
	 * 步骤编码(绑定的业务服务资源编码)
	 */
	@TableField(exist = false)
	@ApiModelProperty(value = "步骤编码", notes = "步骤编码(绑定的业务服务资源编码)")
	private List<String> stepCodes;

	/**
	 * 步骤编码(绑定的业务服务资源编码)
	 */
	@TableField(exist = false)
	@ApiModelProperty(value = "业务编码", notes = "业务编码")
	private List<String> businessCodes;

	@TableField(exist = false)
	@ApiModelProperty(value = "资源匹配串", notes = "资源匹配串")
	private String identifyStr;

	@TableField(exist = false)
	private List<Integer> ids = new ArrayList<>();

}
